<template>

    <section>
        <el-table
                :data="tableData5"
                style="width: 100%">
            <el-table-column
                    label="课程名称"
                    prop="courseName">
            </el-table-column>
            <el-table-column
                    label="公告内容"
                    prop="informInformTitle">
            </el-table-column>
            <el-table-column
                    label="发布人"
                    prop="teacherRealName">
            </el-table-column>
            <el-table-column
                    label="发布日期"
                    prop="informDateStr">
            </el-table-column>
        </el-table>
        <!--分页组件-->
        <el-col :span="24" class="toolbar" >
            <el-button :plain="true" type="info" @click="forback">返回</el-button>
            <!--<el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button>-->
            <el-pagination
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="currentPage"
                    :page-sizes="[15, 20, 25, 30]"
                    :page-size="pageSize"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="total"
                    style="float:right">
            </el-pagination>
        </el-col>
    </section>
</template>

<style>
    .demo-table-expand label {
        width: 90px;
        color: #99a9bf;
    }

</style>

<script>
    import { getCourseNotices } from '../../api/api';
    export default {
        data() {
            return {
                tableData5: [],
                total: 0,//列表总条数
                pageSize:15,//每页条数
                currentPage:1,//当前页码
            }
        },
        mounted() {
            this.getSelectNotices();
        },
        methods: {
            //返回前一页
            forback() {
                this.$router.push({path:'/class_index'});
            },
            handleIconClick(ev) {
                console.log(ev);
            },
            handleSizeChange(val) {
                this.pageSize = val;
                this.getSelectNotices();
            },
            handleCurrentChange(val) {
                this.currentPage = val;
                this.getSelectNotices();
            },
            getSelectNotices() {
                let para = {
                    pageSize:this.pageSize,
                    pageNum:this.currentPage
                };
                para = Object.assign(para, this.filters);
                getCourseNotices(para).then((res) => {
                    this.total = res.resData.total;
                this.tableData5 = res.resData.list;
            });
            },
        },

    }
</script>